package wang.lx.mybatis.controller;


import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import wang.lx.mybatis.entity.SysUser;

@RestController
@RequestMapping("/home")
public class HomeController {
    
    @GetMapping("/")
    public String index() {
        Subject sub = SecurityUtils.getSubject();
        SysUser user = (SysUser) sub.getPrincipal();
        return "this is index"+user.getUsername();
    }
}
